package com.pcbly.web.components.utils;

import java.util.Comparator;
import java.util.Locale;

import com.pcbly.web.bean.user.UserBean;



@SuppressWarnings("unchecked")
public class OfficeComparators {
	
	public static final Comparator LOCALE = new Comparator() {

		public int compare(Locale locale1, Locale locale2) {
			return locale1.getDisplayName().compareTo(locale2.getDisplayName());
		}

		public int compare(Object x0, Object x1) {
			return compare((Locale) x0, (Locale) x1);
		}

	};
	
	public static final Comparator USER = new Comparator() {

        public int compare(UserBean user1, UserBean user2)
        {
            return user1.getUserName().toLowerCase().compareTo(user2.getUserName().toLowerCase());
        }

        public  int compare(Object x0, Object x1)
        {
            return compare((UserBean)x0, (UserBean)x1);
        }

    };
    public static final Comparator LOWER_STRING = new Comparator() {

        public int compare(String s1, String s2)
        {
            return s1.toLowerCase().compareTo(s2.toLowerCase());
        }

        public  int compare(Object x0, Object x1)
        {
            return compare((String)x0, (String)x1);
        }

    };

}
